package com.bingxue.edu.management.shop.model.entity;

import com.bingxue.edu.common.enums.ChangeTypeEnum;
import com.bingxue.edu.common.enums.OperateSourceEnum;
import com.bingxue.edu.common.enums.PayTypeEnum;
import com.bingxue.edu.framework.common.model.BusinessEntity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 退款订单
 *
 * @author zq
 * @since 2024/09/10 00:02
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Table("shop_refund")
public class Refund extends BusinessEntity {

    @Schema(description = "订单id")
    private String orderId;

    @Schema(description = "报名id")
    private String enrollmentId;

    @Schema(description = "课程项id")
    private String orderItemId;

    @Schema(description = "学生id")
    private String studentId;

    @Schema(description = "班级id")
    private String classId;

    @Schema(description = "退课课次顺序列表")
    @Column(typeHandler = JacksonTypeHandler.class)
    private List<Integer> cancelLessonIndexes;

    @Schema(description = "是否退费")
    private Boolean refundOff;

    @Schema(description = "退款金额")
    private BigDecimal refundPrice;

    @Schema(description = "退款方式")
    private PayTypeEnum refundType;

    @Schema(description = "退款时间")
    private LocalDateTime refundTime;

    @Schema(description = "退费账户")
    private String finAccountId;

    @Schema(description = "操作来源")
    private OperateSourceEnum operateSource;

    @Schema(description = "三方系统交易号")
    private String outTradeNo;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "退费原因")
    private ChangeTypeEnum changeType;
}
